<?php


namespace app\api\model;


class Image extends BaseModel
{
    protected $hidden = ['id', 'from', 'update_time', 'delete_time'];

    public function getUrlAttr($value, $data)
    {
        return $this->prefixImgUrl($value, $data);
    }


    /**
     * @return \think\model\relation\BelongsTo
     */
    public function img()
    {
//        一对一模型belongsTo
        return $this->belongsTo('Image', 'img_id', 'id');
    }

}